{% extends 'layout/basic.html' %}
{% load static %}
{% block css %}
    <style>
        .validation {
            position: absolute;
            top: 2000%;
            left: 2000%;
        }


    </style>
{% endblock %}
{% block title %}
    首页
{% endblock %}
{% block content %}
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">

        <link rel="icon" href="{% static 'loginSpecial/images/favicon.ico' %}" type="image/x-icon"/>
        <link rel="shortcut icon" href="{% static 'loginSpecial/images/favicon.ico' %}" type="image/x-icon"/>
        <link href="{% static 'loginSpecial/css/default.css' %}" rel="stylesheet" type="text/css"/>
        <!--必要样式-->
        <link href="{% static 'loginSpecial/css/styles.css' %}" rel="stylesheet" type="text/css"/>
        <link href="{% static 'loginSpecial/css/demo.css' %}" rel="stylesheet" type="text/css"/>
        <link href="{% static 'loginSpecial/css/loaders.css' %}" rel="stylesheet" type="text/css"/>
        <script src="{% static 'loginSpecial/js/jquery-2.1.1.min.js' %}"></script>

    </head>
    <body>
    <div class='login'>

        <!--<img class="MyLogo" src="loginSpecial/images/logo01.png" alt="   LOGO">-->
        <div class='login_fields'>
            <div class='login_fields__password'>
                <div class='validation'>
                    <img alt="" src="{% static 'loginSpecial/img/tick.png' %}">
                </div>
            </div>
            <div class='login_fields__password'>
                <div class='validation' style="opacity: 1; right: -5px;top: -3px;">
                    <canvas class="J_codeimg" id="myCanvas" onclick="Code();">
                        对不起，您的浏览器不支持canvas，请下载最新版浏览器!
                    </canvas>
                </div>
            </div>
            <div class='init01' style='position: relative; left: 40px;top: -100px;transform: scale(1.2);'>
                <a href="{% url 'showlist' way='游戏' %}" onclick="redirectToPage()">
                    <img src="//i0.hdslb.com/bfs/archive/c8fd97a40bf79f03e7b76cbc87236f612caef7b2.png">
                </a>
            </div>
            <p style='position: relative; left: 25px;top: -50px;font-size: 20px;'>
                欢迎使用bilibili视频分析系统
            </p>
            <div class='login_fields__submit'>

                <input type="button" value="进入" style='position: relative;left: 53px; top: 20px;' onclick="redirectToPage()">

                <script>
                    function redirectToPage() {
                        window.location.href = "{% url 'showlist' way='游戏' %}";
                    }
                </script>

            </div>
        </div>
        <div class='success'>
        </div>
    </div>
    <div class='authent'>
        <div class="loader" style="height: 60px;width: 60px;margin-left: 28px;margin-top: 40px">
            <div class="loader-inner ball-clip-rotate-multiple">
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
    </div>
    <div class="OverWindows"></div>

    <link href="{% static 'loginSpecial/layui/css/layui.css' %}" rel="stylesheet" type="text/css"/>
    <!--<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>-->
    <script type="text/javascript" src="{% static 'loginSpecial/js/jquery-ui.min.js' %}"></script>
    <script type="text/javascript" src="{% static 'loginSpecial/js/stopExecutionOnTimeout.js?t=1' %}"></script>
    <script src="{% static 'loginSpecial/layui/layui.js' %}" type="text/javascript"></script>
    <script src="{% static 'loginSpecial/js/Particleground.js' %}" type="text/javascript"></script>
    <script src="{% static 'loginSpecial/js/Treatment.js' %}" type="text/javascript"></script>
    <script src="{% static 'loginSpecial/js/jquery.mockjax.js' %}" type="text/javascript"></script>
    <script src="{% static 'loginSpecial/js/controlLogin.js' %}" type="text/javascript"></script>
    </body>

    <span class="js-cursor-container"></span>
    <script>
        (function fairyDustCursor() {

            var possibleColors = ["#D61C59", "#E7D84B", "#1B8798"]
            var width = window.innerWidth;
            var height = window.innerHeight;
            var cursor = {x: width / 2, y: width / 2};
            var particles = [];

            function init() {
                bindEvents();
                loop();
            }


            function bindEvents() {
                document.addEventListener('mousemove', onMouseMove);
                window.addEventListener('resize', onWindowResize);
            }

            function onWindowResize(e) {
                width = window.innerWidth;
                height = window.innerHeight;
            }

            function onMouseMove(e) {
                cursor.x = e.clientX;
                cursor.y = e.clientY;

                addParticle(cursor.x, cursor.y, possibleColors[Math.floor(Math.random() * possibleColors.length)]);
            }

            function addParticle(x, y, color) {
                var particle = new Particle();
                particle.init(x, y, color);
                particles.push(particle);
            }

            function updateParticles() {


                for (var i = 0; i < particles.length; i++) {
                    particles[i].update();
                }


                for (var i = particles.length - 1; i >= 0; i--) {
                    if (particles[i].lifeSpan < 0) {
                        particles[i].die();
                        particles.splice(i, 1);
                    }
                }

            }

            function loop() {
                requestAnimationFrame(loop);
                updateParticles();
            }


            function Particle() {

                this.character = "*";
                this.lifeSpan = 120; //ms
                this.initialStyles = {
                    "position": "fixed",
                    "display": "inline-block",
                    "top": "0px",
                    "left": "0px",
                    "pointerEvents": "none",
                    "touch-action": "none",
                    "z-index": "10000000",
                    "fontSize": "25px",
                    "will-change": "transform"
                };


                this.init = function (x, y, color) {

                    this.velocity = {
                        x: (Math.random() < 0.5 ? -1 : 1) * (Math.random() / 2),
                        y: 1
                    };

                    this.position = {x: x + 10, y: y + 10};
                    this.initialStyles.color = color;

                    this.element = document.createElement('span');
                    this.element.innerHTML = this.character;
                    applyProperties(this.element, this.initialStyles);
                    this.update();

                    document.querySelector('.js-cursor-container').appendChild(this.element);
                };

                this.update = function () {
                    this.position.x += this.velocity.x;
                    this.position.y += this.velocity.y;
                    this.lifeSpan--;

                    this.element.style.transform = "translate3d(" + this.position.x + "px," + this.position.y + "px, 0) scale(" + (this.lifeSpan / 120) + ")";
                }

                this.die = function () {
                    this.element.parentNode.removeChild(this.element);
                }

            }


            function applyProperties(target, properties) {
                for (var key in properties) {
                    target.style[key] = properties[key];
                }
            }

            if (!('ontouchstart' in window || navigator.msMaxTouchPoints)) init();
        })();
    </script>

    </html>
{% endblock %}